//
//  SearchModel.m
//  Otaku
//
//  Created by lanou3g on 16/5/14.
//  Copyright © 2016年 Liuwx. All rights reserved.
//

#import "SearchModel.h"

@implementation SearchModel

- (CGFloat)cellHeight {
    CGSize maxSize = CGSizeMake([UIScreen mainScreen].bounds.size.width - 2 *10, MAXFLOAT);
    
    CGFloat textHeight = [self.text boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:17]} context:nil].size.height;
    
    _cellHeight = 100 + textHeight;

    return _cellHeight;
}

- (void)setValue:(id)value forKey:(NSString *)key {
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"user"]) {
        [self setValuesForKeysWithDictionary:value];
    }
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
}

@end
